package com.sql;

import com.NettyServer;
import com.object.Gprs;
import com.object.OtaObject;

public class SqlThread implements Runnable{
    public void run() {


        while(true){

            try{
                Thread.sleep(10000);
                OtaObject[] objects = SqlOperation.pollingOtaObject();
                for(OtaObject ob : objects){
                    Gprs gprs = NettyServer.GPRS_MAP.get(ob.gprsId);
                    if (gprs != null){
                        gprs.fireOtaService(ob);
                    }
                }
            }
            catch (Exception ex){
                ex.printStackTrace();
            }



        }
    }
}
